package dao;
import org.apache.ibatis.session.SqlSession;
import pojo.web_Admin;
import pojo.web_Student;
import pojo.web_Teacher;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

public class web_userDaoImpl implements web_userDao{
    public SqlSession sqlSession;
    public web_userDaoImpl(SqlSession sqlSession) {
        this.sqlSession = sqlSession;
    }

    @Override
    public web_Admin queryweb_AdminById(String id) {
        return this.sqlSession.selectOne("web_userDao.queryweb_AdminById", id);
    }
    @Override
    public List<web_Admin> queryweb_AdminAll() {
        return this.sqlSession.selectList("web_userDao.queryweb_AdminAll");
    }

    @Override
    public void insertweb_Admin(web_Admin web_admin) {
        this.sqlSession.insert("web_AdminDao.insertweb_Admin", web_admin);
    }
    @Override
    public void updateweb_Admin(web_Admin web_admin) {
        this.sqlSession.update("web_UserDao.updateweb_Admin", web_admin);
    }


    @Override
    public web_Student queryweb_StudentById(String id) {
        return this.sqlSession.selectOne("web_userDao.queryweb_StudentById", id);
    }
    @Override
    public List<web_Student> queryweb_StudentAll() {
        return this.sqlSession.selectList("web_userDao.queryweb_StudentAll");
    }

    @Override
    public void insertweb_Student(web_Student web_student) {
        this.sqlSession.insert("web_StudentDao.insertweb_Student", web_student);
    }
    @Override
    public void updateweb_Student(web_Student web_student) {
        this.sqlSession.update("web_UserDao.updateweb_Student", web_student);
    }


    @Override
    public web_Teacher queryweb_TeacherById(String id) {
        return this.sqlSession.selectOne("web_userDao.queryweb_TeacherById", id);
    }
    @Override
    public List<web_Teacher> queryweb_TeacherAll() {
        return this.sqlSession.selectList("web_userDao.queryweb_TeacherAll");
    }

    @Override
    public void insertweb_Teacher(web_Teacher web_teacher) {
        this.sqlSession.insert("web_TeacherDao.insertweb_Teacher", web_teacher);
    }
    @Override
    public void updateweb_Teacher(web_Teacher web_teacher) {
        this.sqlSession.update("web_UserDao.updateweb_Teacher", web_teacher);
    }

}
